package ndky;

import java.util.Scanner;

public class MyClass2 {
    public int x;

    public MyClass2(int y){
        System.out.println("包ndky，构造MyClass");

        x=y+10;
    }

    public static void main(String[] args)
    {
        MyClass2 myObj = new MyClass2(10);
        System.out.println(myObj.x);
    }
}
/*
输出：
包ndky，构造MyClass
20
 */